package com.longcai.controller.messagepush;


import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.longcai.bean.ApiResult;
import com.longcai.entity.messagepush.ClyjMessagePushFormwordDesc;
import com.longcai.mapper.messagepush.ClyjMessagePushFormwordDescMapper;
import com.longcai.util.StringUtils;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * <p>
 * 微信模板详情 前端控制器
 * </p>
 *
 * @author kh
 * @since 2019-05-09
 */
@Controller
@RequestMapping("/clyjMessagePushFormwordDesc")
public class ClyjMessagePushFormwordDescController {

	@Autowired
	private ClyjMessagePushFormwordDescMapper clyjMessagePushFormwordDescMapper;
	
	@RequestMapping(value = "queryMessagePushFormwordDesc")
    @ResponseBody
    public ApiResult<?> query(String wxFormworkId){
		if(StringUtils.isEmpty(wxFormworkId)){
			return ApiResult.fail("参数非法，微信模板id不能为空");
		}
		QueryWrapper<ClyjMessagePushFormwordDesc> queryWrapper= new QueryWrapper<ClyjMessagePushFormwordDesc>();
		queryWrapper.eq("wx_formwork_id", wxFormworkId);
		List<ClyjMessagePushFormwordDesc> list=clyjMessagePushFormwordDescMapper.selectList(queryWrapper);
		return ApiResult.success(list);
	}
}

